package com.hippo4j.plugin.manager;

import com.hippo4j.executor.DynamicThreadPoolExecutor;
import com.hippo4j.plugin.impl.TaskRejectCountRecordPlugin;
import com.hippo4j.plugin.impl.TaskTimeOutNotifyAlarmPlugin;
import com.hippo4j.plugin.impl.ThreadPoolExecutorShutDownPlugin;

public class DefaultThreadPoolPluginRegister implements ThreadPoolPluginRegister {

    @Override
    public void doRegister(DynamicThreadPoolExecutor executor) {
        ThreadPoolPluginManager pluginManager = executor.getPluginManager();
        pluginManager.registerPlugin(new TaskRejectCountRecordPlugin());
        pluginManager.registerPlugin(new TaskTimeOutNotifyAlarmPlugin(500));
        pluginManager.registerPlugin(new ThreadPoolExecutorShutDownPlugin());
    }
}
